cmake_minimum_required(VERSION 3.16)
project(erlua)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_VERBOSE_MAKEFILE ON)      # 查看实际build的时候执行的命令
# option(USE_GCOV "Create a GCov-enabled build." OFF)

# message("================开始查找Erlang库目录================")
set(SOURCE_LS 
	listings/listing_1.1.cpp
	listings/listing_10.1.cpp
	listings/listing_10.2.cpp
	listings/listing_10.3.cpp
	listings/listing_11.1.cpp
	listings/listing_2.1.cpp
	listings/listing_2.2.cpp
	listings/listing_2.3.cpp
	listings/listing_2.4.cpp
	listings/listing_2.5.cpp
	listings/listing_2.6.cpp
	listings/listing_2.7.cpp
	listings/listing_2.8.cpp
	listings/listing_3.1.cpp
	listings/listing_3.10.cpp
	listings/listing_3.11.cpp
	listings/listing_3.12.cpp
	listings/listing_3.13.cpp
	listings/listing_3.2.cpp
	listings/listing_3.3.cpp
	listings/listing_3.4.cpp
	listings/listing_3.5.cpp
	listings/listing_3.6.cpp
	listings/listing_3.7.cpp
	listings/listing_3.8.cpp
	listings/listing_3.9.cpp
	listings/listing_4.1.cpp
	listings/listing_4.10.cpp
	listings/listing_4.11.cpp
	listings/listing_4.12.cpp
	listings/listing_4.13.cpp
	listings/listing_4.14.cpp
	listings/listing_4.15.cpp
	listings/listing_4.16.cpp
	listings/listing_4.17.cpp
	listings/listing_4.18.cpp
	listings/listing_4.19.cpp
	listings/listing_4.2.cpp
	listings/listing_4.20.cpp
	listings/listing_4.21.cpp
	listings/listing_4.22.cpp
	listings/listing_4.23.cpp
	listings/listing_4.24.cpp
	listings/listing_4.25.cpp
	listings/listing_4.26.cpp
	listings/listing_4.27.cpp
	listings/listing_4.3.cpp
	listings/listing_4.4.cpp
	listings/listing_4.5.cpp
	listings/listing_4.6.cpp
	listings/listing_4.7.cpp
	listings/listing_4.8.cpp
	listings/listing_4.9.cpp
	listings/listing_5.1.cpp
	listings/listing_5.10.cpp
	listings/listing_5.11.cpp
	listings/listing_5.12.cpp
	listings/listing_5.13.cpp
	listings/listing_5.2.cpp
	listings/listing_5.3.cpp
	listings/listing_5.4.cpp
	listings/listing_5.5.cpp
	listings/listing_5.6.cpp
	listings/listing_5.7.cpp
	listings/listing_5.8.cpp
	listings/listing_5.9.cpp
	listings/listing_6.1.cpp
	listings/listing_6.10.cpp
	listings/listing_6.11.cpp
	listings/listing_6.12.cpp
	listings/listing_6.13.cpp
	listings/listing_6.2.cpp
	listings/listing_6.3.cpp
	listings/listing_6.4.cpp
	listings/listing_6.5.cpp
	listings/listing_6.6.cpp
	listings/listing_6.7.cpp
	listings/listing_6.8.cpp
	listings/listing_6.9.cpp
	listings/listing_7.1.cpp
	listings/listing_7.10.cpp
	listings/listing_7.11.cpp
	listings/listing_7.12.cpp
	listings/listing_7.13.cpp
	listings/listing_7.14.cpp
	listings/listing_7.15.cpp
	listings/listing_7.16.cpp
	listings/listing_7.17.cpp
	listings/listing_7.18.cpp
	listings/listing_7.19.cpp
	listings/listing_7.2.cpp
	listings/listing_7.20.cpp
	listings/listing_7.21.cpp
	listings/listing_7.22.cpp
	listings/listing_7.3.cpp
	listings/listing_7.4.cpp
	listings/listing_7.5.cpp
	listings/listing_7.6.cpp
	listings/listing_7.7.cpp
	listings/listing_7.8.cpp
	listings/listing_7.9.cpp
	listings/listing_8.1.cpp
	listings/listing_8.10.cpp
	listings/listing_8.11.cpp
	listings/listing_8.12.cpp
	listings/listing_8.13.cpp
	listings/listing_8.2.cpp
	listings/listing_8.3.cpp
	listings/listing_8.4.cpp
	listings/listing_8.5.cpp
	listings/listing_8.6.cpp
	listings/listing_8.7.cpp
	listings/listing_8.8.cpp
	listings/listing_8.9.cpp
	listings/listing_9.1.cpp
	listings/listing_9.10.cpp
	listings/listing_9.11.cpp
	listings/listing_9.12.cpp
	listings/listing_9.13.cpp
	listings/listing_9.2.cpp
	listings/listing_9.3.cpp
	listings/listing_9.4.cpp
	listings/listing_9.5.cpp
	listings/listing_9.6.cpp
	listings/listing_9.7.cpp
	listings/listing_9.8.cpp
	listings/listing_9.9.cpp
	listings/listing_a.1.cpp
	listings/listing_a.2.cpp
	listings/listing_a.3.cpp
	listings/listing_a.4.cpp
	listings/listing_c.1.cpp
	listings/listing_c.10.cpp
	listings/listing_c.2.cpp
	listings/listing_c.3.cpp
	listings/listing_c.4.cpp
	listings/listing_c.5.cpp
	listings/listing_c.6.cpp
	listings/listing_c.7.cpp
	listings/listing_c.8.cpp
	listings/listing_c.9.cpp
)

set(EXEC_LS 
	listings/listing_1.1.cpp
)

foreach(E_SOURCE ${EXEC_LS})
	message(E_SOURCE ${E_SOURCE})
    get_filename_component(NAME_WITHOUT_WLE ${E_SOURCE} NAME_WLE)
    set(TARGET_NAME ${NAME_WITHOUT_WLE}.out)
	add_executable(${TARGET_NAME} ${E_SOURCE})
endforeach()
